﻿using System;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;

namespace MusicStore.WebMVC.Models
{
    public class Album
    {
        public int AlbumId { get; set; }

        [Required]
        public string Title { get; set; }

        [Required(ErrorMessage="{0} is required")]
        [Range(0.01, 100, ErrorMessage="price must be between {1} and {2}")]
        public decimal Price { get; set; }

        [Display(Name="album art url")]
        [StringLength(1024, ErrorMessage="maxlength = 1024")]
        public string AlbumArtUrl { get; set; }

        [Display(Name="genre")]
        public int GenreId { get; set; }

        [Display(Name="artist")]
        public int ArtistId { get; set; }
        
        public virtual Genre Genre { get; set; }
        public virtual Artist Artist { get; set; }
        public virtual List<OrderDetail> OrderDetails { get; set; }
    }
}